$.get('/admin/visual/message_num').done(function (data) {
    var myChart = echarts.init(document.getElementById('message_num'),'macarons');
    var message_num = [];
    $.each(data.count.message, function (k, v) {
        message_num.push(v)
    });

    myChart.setOption ({

        title : {
            text: '一周发言情况',
            subtext: data.week_start + ' ~ ' + data.week_end,
        },
        tooltip : {
            trigger: 'axis'
        },

        toolbox: {
            show : true,
            feature : {
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar']},
                restore : {show: true},
                saveAsImage : {show: true},
            }
        },
        color: ['#7AAFB6'],
        calculable : true,
        xAxis : [
            {
                type : 'category',
                data : ['星期一','星期二','星期三','星期四','星期五','星期六','星期天']
            }
        ],
        yAxis : [
            {
                type : 'value',
                axisLabel: {
                    formatter: '{value} 条'
                }
            }
        ],
        series : [

            {
                name:'在线时间',
                type:'bar',
                data:message_num,
            }
        ]
    });
    window.onresize = myChart.resize;
});



